//
//  HomeNavTitView.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/8.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "HomeNavTitView.h"

@implementation HomeNavTitView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor colorWithHexString:@"#F2F2F2"];
        self.layer.cornerRadius = kHeightProportion_In_iPhoneTriploid(15);
        self.layer.masksToBounds = YES;
        //
        GLGWImageView * searchImageView = [[GLGWImageView alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(14), kHeightProportion_In_iPhoneTriploid(8), kWidthProportion_In_iPhoneTriploid(16), kHeightProportion_In_iPhoneTriploid(15)) imageName:@"home_sousuo" inSuperView:self];
        //
        GLGWLabel * searchLabel = [[GLGWLabel alloc] initWithFrame:CGRectMake(kX_With_View(searchImageView, 6), kHeightProportion_In_iPhoneTriploid(5), kWidthProportion_In_iPhoneTriploid(150), kHeightProportion_In_iPhoneTriploid(20)) theFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#999999"] inSuperView:self];
        searchLabel.text = @"输入商品/求购单/店铺";
        //
        self.saoMaBut = [[GLGWButton alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(205), 0, kWidthProportion_In_iPhoneTriploid(45),kHeightProportion_In_iPhoneTriploid(30)) inSuperView:self];
        self.saoMaBut.image_Name = @"home_saosao";
        if (self.accountType == AccountType_Ordinary) {
            self.saoMaBut.hidden = YES;
        }
        //
        UITapGestureRecognizer * tap_nav = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap_search_Action)];
        tap_nav.numberOfTouchesRequired = 1;
        tap_nav.numberOfTapsRequired = 1;
        [self addGestureRecognizer:tap_nav];
        self.userInteractionEnabled = YES;
    }
    return self;
}

-(void)tap_search_Action{
    if (self.Block_SearchAction) {
        self.Block_SearchAction();
    }
}

@end
